package packet;

import shared.Consts.Priorities;
import client.ClientController;

/**
 *
 * @author Joel Garboden
 */
public class ChatCmd extends Command
{
  private String message;
  private String playerName;

  /**
   *
   * @param playerName
   * @param message
   */
  public ChatCmd(String playerName, String message)
  {
    this.playerName = playerName;
    this.priority = Priorities.CHAT_MSG;
    this.message = message;
  }

  @Override
  public boolean execCommand(ClientController client)
  {
    client.postChat(playerName, message);
    return true;
  }

  @Override
  public String toString()
  {
    return playerName + ": " + message;
  }
}
